package com.ywps.vaas.framework.util

import com.ywps.vaas.framework.conf.ConfigTools
import com.ywps.vaas.framework.constant.PropertiesConstant

import java.util.Properties

object HiveUtil {

  val properties: Properties = ConfigTools.getPropertiesFactory()

  def getConf(): Properties = {
    val ConnProperties = new Properties();
    ConnProperties.put(PropertiesConstant.HIVE_METASTORE_URIS_NAME, properties.getProperty(PropertiesConstant.HIVE_METASTORE_URIS));
    ConnProperties.put(PropertiesConstant.SPARK_SQL_WAREHOUSE_DIR_NAME, properties.getProperty(PropertiesConstant.SPARK_SQL_WAREHOUSE_DIR));
    ConnProperties;
  }

  def getHiveMetastoreUris(): String = {
    getConf().get(PropertiesConstant.HIVE_METASTORE_URIS_NAME).toString
  }

  def getSparkSqlWarehouseDir(): String = {
    getConf().get(PropertiesConstant.SPARK_SQL_WAREHOUSE_DIR_NAME).toString
  }
}
